package org.feng.api.animal.request;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.feng.api.DateRange;
import org.feng.api.OrderByMode;
import org.feng.api.OrderedRequest;
import org.feng.api.PageRequest;

import java.io.Serial;
import java.io.Serializable;

/**
 * 查询动物请求对象
 *
 * @author feng
 */
@EqualsAndHashCode(callSuper = true)
@Data
@ApiModel(description = "查询动物请求对象")
public class QueryAnimalRequest extends PageRequest implements Serializable, OrderedRequest {
    @Serial
    private static final long serialVersionUID = 2697376914663625438L;

    @ApiModelProperty(name = "name", value = "动物名称")
    private String name;

    @ApiModelProperty(name = "age", value = "年龄")
    private Integer age;

    @ApiModelProperty(name = "animalTypeCode", value = "动物类型code")
    private Integer animalTypeCode;

    @ApiModelProperty(name = "animalSexCode", value = "动物性别code")
    private Integer animalSexCode;

    @ApiModelProperty(name = "createDateRange", value = "创建日期范围")
    private DateRange createDateRange;

    @ApiModelProperty(name = "updateDateRange", value = "更新日期范围")
    private DateRange updateDateRange;

    @ApiModelProperty(name = "orderByMode", value = "排序方式", hidden = true)
    private QueryAnimalRequestOrderByMode orderByMode;

    @Data
    @ApiModel(description = "查询动物请求对象排序模式")
    public static class QueryAnimalRequestOrderByMode implements OrderByMode {
        @ApiModelProperty(name = "createTime", value = "按创建时间排序", example = DESC)
        private String createTime;

        @ApiModelProperty(name = "updateTime", value = "按修改时间排序", example = DESC)
        private String updateTime;
    }
}
